package org.example.backend.demos.web.ImageModule.controller;

import org.example.backend.demos.web.ImageModule.service.impl.CosServise;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;


@RestController()
@RequestMapping("cos")
public class CosControler {
    @Autowired
    public CosServise cosServise;

    // 上传文件
    @PostMapping("api/user/upimage")
    public String upImage(@RequestParam("file") MultipartFile file) {
        return cosServise.upfile(file);
    }

    // 下载图片
    @PostMapping("api/user/downimage")
    public String downImage() throws InterruptedException {
        return cosServise.downfile();
    }






}
